home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lantools / blueprnt / child.mod < prev    next >
Text File  |  1989-09-27  |  3KB  |  83 lines

  1. ;************************************************************
  2. ;* Child Process Creation Module                (CHILD.MOD) *
  3. ;* by Craig Chaiken                                         *
  4. ;* September 20, 1989                                       *
  5. ;*                                                          *
  6. ;* Function: Executes DOS Command Line as Child Process.    *
  7. ;************************************************************
  8. ;
  9. ;*** Variables ***
  10. ;
  11. pblock:
  12. envstr  dw      ?
  13. comlin  dw      ?,?
  14. fcb1    dw      ?,?
  15. fcb2    dw      ?,?
  16. fname   db      '\command.com',0
  17. command db      3,'/c '
  18.         db      128 dup (?)
  19. drvmod  db      26 dup (-1)
  20.  
  21. comman  proc    near
  22.         cmp     packet_buffer,'E'
  23.         jz      comma1
  24.         ret
  25. comma1: mov     cx,packet_length
  26.         dec     cx
  27.         add     byte ptr command,cl
  28.         lea     si,packet_buffer+1
  29.         lea     di,command+3
  30.         call    sitodi
  31.         jmp     child
  32. comman  endp
  33.  
  34. child   proc    near            ;*** Executes Child Process ***
  35.         call    drive_unknown_state
  36.         mov     ax,4a00h        ;determine free memory
  37.         mov     bx,07ffh
  38.         int     21h
  39.  
  40.         mov     ax,cs                   ;initialize child's environment
  41.         mov     [comlin+2],ax           ;command tail segment
  42.         mov     [fcb1+2],ax             ;file control block 1 segment
  43.         mov     [fcb2+2],ax             ;file control block 2 segment
  44.         mov     ax,[2ch]                ;segment of environment block
  45.         mov     word ptr [envstr],0
  46.         lea     ax,command              ;offset of command tail
  47.         mov     [comlin],ax
  48.         mov     ax,5ch                  ;offset of fcb 1
  49.         mov     [fcb1],ax
  50.         mov     al,6ch                  ;offset of fcb 2
  51.         mov     [fcb2],ax
  52.  
  53.         mov     ax,4b00h                ;load and execute command
  54.         lea     bx,pblock
  55.         lea     dx,fname
  56.         int     21h
  57.  
  58.         mov     ax,4900h                ;release memory
  59.         int     21h
  60.         cli
  61.         mov     ss,cs:sslocal
  62.         mov     sp,cs:splocal
  63.         sti
  64.         push    cs
  65.         pop     ds
  66.         ret
  67. child   endp
  68.  
  69.  
  70. drive_unknown_state     proc    near    ;flag all drives as modified
  71.         lea     si,drive_table
  72.         mov     bx,maxsockets
  73.         mov     cl,5
  74.         shl     bx,cl
  75.         mov     al,-1
  76.         rep     stosb
  77.         ret
  78. drive_unknown_state     endp
  79.  
  80. ;************************************************************
  81. ;* End of Child Process Creation Module                     *
  82. ;************************************************************
  83.